<?php
class ClsLDB
{
    private $arrTable=array();
    public function __construct() 
    {
    }
    public function addTable($table)
    {
        $this->arrTable[$table]=array();
    }
    public function addTables($arrTable)
    {
        foreach($arrTable as $table)
        {
            $this->arrTable[$table]=array();
        }
    }
    public function addFields($table,$arrField)
    {
        foreach($arrField as $field)
        {
            $this->arrTable[$table][$field]=array();
        }
    }
    public function addForeignKey($table,$field,$foreignKeyField)
    {
        $this->arrTable[$table][$field]["key"]["foreign"]=$foreignKeyField;
    }
    public function getTable()
    {
        return $this->arrTable;
    }
    public static function &getInstance($db)
    {
        static $objDB=array();
        if($db=="__GET__ALL__DB__") return $objDB;
        if(!isset($objDB[$db]))
        {
            $objDB[$db]=new ClsLDB();
        }
        return $objDB[$db];
    }
}
?>
